package com.qianji.controller;

import com.qianji.pojo.AdparticularsDto;
import com.qianji.pojo.MediaDto;
import com.qianji.service.RevenueService;
import com.qianji.utils.Result;
import com.qianji.vo.AdvertisementVO;
import com.qianji.vo.MediaVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created by 阳家桂 on 2021/3/29 14:15
 * 数据收益
 */

@RestController
@RequestMapping("revenue")
public class DataRevenueController {
    @Autowired
    private RevenueService revenueService;



    @ApiOperation("根据条件查询广告收益")
    @RequestMapping(value = "adver/select",method = RequestMethod.POST)
    public Result adRevenue(@RequestBody AdvertisementVO advertisementVO){
        return revenueService.selectAdver(advertisementVO);
    }



    @ApiOperation("广告位每日数据")
    @RequestMapping(value = "adver/dailydata",method = RequestMethod.POST)
    public Result<AdparticularsDto> adverDaily(@RequestBody AdvertisementVO advertisementVO) {

        return revenueService.adverDaily(advertisementVO);
    }


    @ApiOperation("根据条件查询媒体收益")
    @RequestMapping(value = "media/select",method = RequestMethod.POST)
    public Result mediaRevenue(@RequestBody MediaVO mediaVO){
        return revenueService.selectMedia(mediaVO);
    }


    @ApiOperation("媒体每日数据")
    @RequestMapping(value = "media/dailydata",method = RequestMethod.POST)
    public Result<MediaDto> mediaDaily(@RequestBody MediaVO mediaVO) {
        return revenueService.mediaDaily(mediaVO);
    }


}
